package itsm.isperp.module.dto.task;

import itsm.isperp.module.entity.task.TskPlanTask;

import java.util.ArrayList;
import java.util.List;

public class TskPlanTaskTestDTO extends TskPlanTask {

	/**
	 *                                   
	 */
	private static final long serialVersionUID = 1L;

	public List<String> getSelectedWeekDay() {
		String[] tmp = this.getExcuteWeekDays().split(",");
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < tmp.length; i++) {
			list.add(tmp[i]);
		}
		return list;
	}

	public void setSelectedWeekDay(List<String> selectedWeekDay) {

		String tmp = "";
		for (int i = 0; i < selectedWeekDay.size(); i++) {
			if (i != selectedWeekDay.size() - 1) {
				tmp = tmp + selectedWeekDay.get(i) + ",";
			} else {
				tmp = tmp + selectedWeekDay.get(i);
			}
		}
		this.setExcuteWeekDays(tmp);

	}
}
